import {Component} from '@angular/core';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  title = '后台管理系统';
  private name: string;
  private date:Date;

  constructor() {
    this.name = localStorage.getItem('name');
  }

  ngOnInit() {
    setInterval(() => {
      this.showTime();
    }, 1000);
  }

  showTime() {
    this.date = new Date();
  }
}
